<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>六西格玛知识管理</title>
<link href="<?php echo $this->baseUrl ?>/public/style/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jquery.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/chart/js/swfobject.js"></script>

<style>
.chart_content{margin-bottom:10px;}
.box-list span{ padding:0 10px}
</style>
</head>

<body>
<!--头部-->
<?php echo $this->partial('common/header.html', array('template'=>$this->template, 'baseUrl'=>$this->baseUrl)) ?>

<!--主体-->
<div class="main-box" id="mainBox">
    <div class="third-menu">
        <?php echo $this->partial('common/operation.html', array('template'=>$this->template, 'baseUrl'=>$this->baseUrl)) ?>
        <div class="menu-title"><span class="icon"></span>客户首页</div>
    </div>
  <div class="search">
  	<form method="get" action="<?php echo $this->baseUrl;?>/company/list" name="search">
        <label>客户名称:</label>
        <input type="text" class="input" name="search_name" value="<?php echo !empty($_GET['search_name'])?$_GET['search_name']:'' ?>" />
        <input type="submit" class="submit input" value="搜 索" />
    </form>
  </div>    
    <div class="separate-line"></div>
</div>
<div class="mod-lss">
	<div class="main">
		<div class="left">
			<div class="box">
                <div class="box-title-modul">推荐学生最多的客户列表</div>
                <ul class="box-list">
                	<?php if ($this->top10companys): ?>
                    <?php foreach ($this->top10companys as $key => $val): ?>
                    <li class="box-item"><a href="<?php echo $this->baseUrl ?>/company/detail?company_id=<?php echo $val['company_id']; ?>"><?php echo $val['company_name']; ?></a></li>
                    <?php endforeach; ?>
                    <?php endif; ?>
                </ul>
            </div>
            <div class="box">
                <div class="box-title-modul">最新加入客户列表</div>
                <ul class="box-list">
                	<?php if ($this->top): ?>
                    <?php foreach ($this->top as $key => $val): ?>
                    <li class="box-item"><a href="<?php echo $this->baseUrl ?>/company/detail?company_id=<?php echo $val['company_id']; ?>"><?php echo $val['name']; ?></a></li>
                    <?php endforeach; ?>
                    <?php endif; ?>
                </ul>
            </div>
		</div>
		<div class="right">
        	<div class="box">
				<div class="box-title-modul">客户模块统计</div>
				<ul class="box-list">
                    <li class="box-item">系统中共有客户<?php echo $this->total; ?>个</li>
                    <?php foreach($this->company_count as $k=>$v){
                                  if($v['count']!=0){ ?>
                   <li class="box-item"><?php echo $v['year'];?>年有客户<?php echo $v['count']; ?>个</li>   
                    <?php } }?>
				</ul>
			</div>
            <div class="box main-box">
				<div class="box-title-modul">客户模块数据</div>      
	                <div class="chart_content">
	                    <table width="756px" border="1" bordercolor="#0066FF" align="center">
	                            <tr align="center">
	                            <th width="5%">SN</th>
	                            <!--th width="12%">上级客户</th-->
	                            <th width="">单位名称</th>
	                            <th width="5%">代号</th>
	                            <th width="10%">简称</th>
	                            <th width="8%">地点</th>
	                            <!--th width="5%">GB人数</th>
	                            <th width="5%">BB人数</th>
	                            <th width="5%">CH人数</th>
	                            <th width="5%">TT人数</th>
	                            <th width="5%">关注度</th>
	                            <th width="10%">成熟度级别</th>
	                            <th width="8%">客户类别</th-->
	                        </tr>
	
	                        <?php foreach ($this->companys as $key=>$val): ?>
	                        <tr align="center">
	                            <td><?php echo $val['company_id'];?></td>
	                            <!--td><?php echo $val['pid'];?></td-->
	                            <td><a href="<?php echo $this->baseUrl ?>/company/detail?company_id=<?php echo $val['company_id']; ?>"><?php echo $val['name'];?></a></td>
	                            <td><?php echo $val['mark'];?></td>
	                            <td><?php echo $val['short_name'];?></td>
	                            <td><?php echo $val['location'];?></td>
	                            <!--td></td>
	                            <td></td>
	                            <td></td>
	                            <td></td>
	                            <td></td>
	                            <td></td>
	                            <td></td-->
	                        </tr>
	                        <?php endforeach; ?>
	
	                    </table>
	                     <div class="page-bar" style="height:27px;padding-top: 10px;">
	                        <p>总数：<span class="total-count"><?php echo $this->total ?></span></p>
	                        <p>
	                        <?php if ($this->page > 1): ?>
	                        <a href="<?php echo $this->baseUrl ?>/company/index?page=1">首页</a>
	                        <?php else: ?>
	                        首页
	                        <?php endif; ?>
	                        <?php if ($this->page > 1): ?>
	                        <a href="<?php echo $this->baseUrl ?>/company/index?page=<?php echo $this->page-1 ?>">上一页</a>
	                        <?php else: ?>
	                        上一页
	                        <?php endif; ?>
	                        <?php if ($this->page < $this->pages): ?>
	                        <a href="<?php echo $this->baseUrl ?>/company/index?page=<?php echo $this->page+1 ?>">下一页</a>
	                        <?php else: ?>
	                        下一页
	                        <?php endif; ?>
	                        <?php if ($this->page < $this->pages): ?>
	                        <a href="<?php echo $this->baseUrl ?>/company/index?page=<?php echo $this->pages ?>">尾页</a>
	                        <?php else: ?>
	                        尾页
	                        <?php endif; ?>
	                        </p>
	                        <p>页数：<span class="page-detail"><?php echo $this->page ?>/<?php echo $this->pages ?></span></p>
	                        <p>转到
	                        <select id="page_select">
	                        <?php
                                for($i=1; $i<=$this->pages; $i++){
                                    if ($this->page == $i) {
                                    	echo "<option value='$i' selected='selected'>$i/$this->pages</option>";
                                    }else{
                                        echo "<option value='$i'>$i/$this->pages</option>";
                                    }
                                }
                            ?>
	                    	</select>
	                </p>
	                 </div>
	           </div>
			</div>
		</div>
	</div>
</div>

<script>
$(document).ready(function(){
	$("#page_select").change(function(){
		var page = $(this).val();
		location.href = "<?php echo $this->baseUrl ?>/company/index?page="+page;
	});
});
</script>
<!--底部-->
<?php echo $this->partial('common/footer.html') ?>
</body>
</html>